package com.qd.panda.func;

import com.qd.common.panda.domain.entity.func.ChannelDTO;
import com.qd.panda.service.func.ChannelService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

/**
 * 渠道/APP_渠道推广
 *
 * @author sjk
 */
@RequiredArgsConstructor
@Validated
@RestController
@RequestMapping("/app/channel/")
@Slf4j
public class AppChannelController {
    private final ChannelService channelService;

    /**
     * 详情
     *
     * @param id 主键
     * @return 记录
     */
    @GetMapping(value = "/getById")
    public ChannelDTO getById(@Validated @NotBlank(message = "ID不能为空") String id) {
        return channelService.getByIdDto(id);
    }
}